Fix ACL hook routing for internal proxy system resources#10372
Fix ACL hook routing for internal proxy system resources#10372somiljain2006 wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #10372 +/- ##
=============================================
- Coverage 48.96% 48.90% -0.07%
- Complexity 13473 13476 +3
=============================================
Files 1376 1378 +2
Lines 100546 100620 +74
Branches 12984 13000 +16
=============================================
- Hits 49236 49211 -25
- Misses 45310 45378 +68
- Partials 6000 6031 +31 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
这个 PR 用一个复杂的 dual-hook 路由机制,绕过了一个可能只是配置问题的 bug。 从架构上讲,这是一个反模式——它让 proxy 在某些路径上使用用户凭证跟 broker 通信,这本身就违背了 proxy 作为可信中间层的设计原则。 |
|
Thanks for the review. I agree the current dual-hook routing introduces additional complexity at the RPC layer. If this direction does not align with the intended authentication architecture for the proxy, I’m open to close the PR or explore a simpler approach that better fits the existing design. |
Which Issue(s) This PR Fixes
Brief Description
This PR fixes ACL authentication issues for internal proxy system-resource requests in cluster mode when enableAclRpcHookForClusterMode=true is enabled. Introduced SystemResourceAwareRpcHook and InternalContextHolder to ensure that only trusted internal proxy operations targeting RocketMQ system resources use proxy admin ACL credentials, while normal client requests continue using user credentials.
How Did You Test This Change?
Added comprehensive unit tests covering:
Manual verification was also performed successfully using NameServer + Broker + Proxy with ACL enabled.